#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("prime.in" , "r" , stdin);
	freopen("prime.out" , "w" , stdout);
	int a , m = 2;
	cin >> a;
	while(m * m <= a){
		if(a % m == 0){
			break;
		}
		m = m + 1;
	}
	cout << a / m << endl;
	return 0;
}
